package models;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import play.db.ebean.Model;

@Entity
@Table(name = "observacoes")
public class Observacoes extends Model {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@Column(name = "obse_id")
	private Integer id;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "obse_ngan_id", nullable = false)
	private Analises analise;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "obse_data", nullable = false)
	private Date dtCadastro;
	
	@Column(name = "obse_visivel", nullable = false)
	private boolean visivel;

	public Observacoes() {
		super();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Analises getAnalise() {
		return analise;
	}

	public void setAnalise(Analises analise) {
		this.analise = analise;
	}

	public Date getDtCadastro() {
		return dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}

	public boolean isVisivel() {
		return visivel;
	}

	public void setVisivel(boolean visivel) {
		this.visivel = visivel;
	}
	
	public static Model.Finder<Integer, Observacoes> find = new Finder<Integer, Observacoes>(Integer.class, Observacoes.class);
	
}
